package licode.unisop.unilite.dp;

import java.util.List;

public class PageData<T> {
    /**
     * 当前分页的页码
     */
    private long current;

    /**
     * 当前页的记录条数
     */
    private long size;

    /**
     * 当前满足查询条件的总记录条数
     */
    private long total;

    /**
     * 当前分页的总页数
     */
    private long pages;

    private List<T> data;

    public PageData() {
        this.current = 0;
        this.size = 0;
        this.pages = 0;
        this.total = 0;
    }

    public PageData(long current, long size, long total, long pages, List<T> data) {
        this.current = current;
        this.size = size;
        this.total = total;
        this.pages = pages;
        this.data = data;
    }

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }

    public long getCurrent() {
        return current;
    }

    public void setCurrent(long current) {
        this.current = current;
    }

    public long getSize() {
        return size;
    }

    public void setSize(long size) {
        this.size = size;
    }

    public long getPages() {
        return pages;
    }

    public void setPages(long pages) {
        this.pages = pages;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    @Override
    public String toString() {
        return "PageData{" +
                "current=" + current +
                ", size=" + size +
                ", total=" + total +
                ", pages=" + pages +
                ", data=" + data +
                '}';
    }
}
